﻿--[[
   @brief    game library model
   @author   phenixwu
   @version  1.0
   @date     2015-03-13
--]]

game_library_model = {
    -- 游戏类型
    ROLE_GAME_TYPE = 1;
    MATCH_GAME_TYPE = 2;
    LEISURE_GAME_TYPE = 4;
    MOBILE_GAME_TYPE = 6;
    game_base_info_ready = false;
    current_select_game_id = 0;
    ad_tag = "";
    op_from = 0;
    -- 游戏库子页面目录与排列方式
    mmog_page = false;
    main_type = 0;
    category = 0;
    sub_type = 0;
    sort = 2;
    alpha = "";
    -- 用户的当前等级
    current_level = 0;

    -- 请求回包队列
    play_game_rsp_info_queue = nil;
    attent_game_rsp_info_queue = {first = 1, last = 0};

    -- 期待榜
    expect_game_list = nil;
    attent_game_list = nil;

    -- 请求关注游戏列表来源id
    ATTENT_GAME_LIST_BOUTIQUE = 1;
    ATTENT_GAME_LIST_MMOG = 2;

    game_attent_query_id = 0;

    wait_remove_list_game_id = 0;

    game_main_type = {
        MMOG_GAME = 1,
        WEB_GAME = 2,
        CONSOLE_GAME = 3,
        MOBILE_GAME = 4
    };

    --[[
    -- LCU版本信息更新
    lcu_req_param = nil;
    lcu_plugin_update_browser_id = nil;
    ]]

    init = function()
        -- 添加对个人信息的事件监听，主要处理等级的事件
        local tpf_ui =
            base_utility.get_component_adapter("ITpf_ui",
                "ierd_tgp.tpf_ui.GetTPFUI();");
        tpf_ui:AddLuaListener(ierd_tgp.users_info.USER_INFO_ON_CHANGE_SELF_INFO, "game_library_control.set_info");

        -- 关注等级更新
        event_center.add_listener(main_event.UPDATE_USER_INFO, "game_library_control.set_info");
        base_utility.log("[game_library_model] init success");
    end;
}

game_library_model.init();
